<?php
/*
 * @Author: lokei
 * @Date: 2022-09-28 20:55:13
 * @LastEditors: lokei
 * @LastEditTime: 2022-12-31 18:49:22
 * @Description: 
 */
$router->group(['prefix' => env('ROUTER_PREFIX') . 'api'], function () use ($router) {
	
	/** 公告 */
	$router->group(['prefix' => 'activity'], function () use ($router) {
		// Activity
		$router->get('get', [
			'as' => 'getActivity', 'uses' => '\App\Http\Controllers\Activity\ActivityController@get'
		]);
		$router->get('list', [
			'as' => 'ActivityList', 'uses' => '\App\Http\Controllers\Activity\ActivityController@list'
		]);
		$router->post('update', [
			'as' => 'updateActivity', 'uses' => '\App\Http\Controllers\Activity\ActivityController@update'
		]);
		$router->post('create', [
			'as' => 'createActivity', 'uses' => '\App\Http\Controllers\Activity\ActivityController@create'
		]);
		$router->post('delete', [
			'as' => 'deleteActivity', 'uses' => '\App\Http\Controllers\Activity\ActivityController@delete'
		]);
		// content
		$router->post('content/set', [
			'as' => 'setContent', 'uses' => '\App\Http\Controllers\Activity\ContentController@set'
		]);

	});

	$router->group(['prefix' => 'activity/record'], function () use ($router) {
		// join
		$router->get('list', [
			'as' => 'recordList', 'uses' => '\App\Http\Controllers\Activity\RecordController@list'
		]);
		$router->post('delete', [
			'as' => 'deleteRecord', 'uses' => '\App\Http\Controllers\Activity\RecordController@delete'
		]);
	});
	$router->group(['prefix' => 'activity/record', 'middleware' => 'auth'], function () use ($router) {
		// join
		$router->post('join', [
			'as' => 'joinActivity', 'uses' => '\App\Http\Controllers\Activity\RecordController@join'
		]);
		$router->post('joinCard', [
			'as' => 'joinCardActivity', 'uses' => '\App\Http\Controllers\Activity\RecordController@joinCard'
		]);
		$router->post('ofMe', [
			'as' => 'ofMeActivity', 'uses' => '\App\Http\Controllers\Activity\RecordController@ofMe'
		]);
	});
	
	/** 礼品 */
	$router->group(['prefix' => 'gift'], function () use ($router) {
		// Gift
		$router->get('get', [
			'as' => 'getGift', 'uses' => '\App\Http\Controllers\Activity\Gift\GiftController@get'
		]);
		$router->get('list', [
			'as' => 'giftList', 'uses' => '\App\Http\Controllers\Activity\Gift\GiftController@list'
		]);
		$router->post('update', [
			'as' => 'updateGift', 'uses' => '\App\Http\Controllers\Activity\Gift\GiftController@update'
		]);
		$router->post('create', [
			'as' => 'createGift', 'uses' => '\App\Http\Controllers\Activity\Gift\GiftController@create'
		]);
		$router->post('delete', [
			'as' => 'deleteGift', 'uses' => '\App\Http\Controllers\Activity\Gift\GiftController@delete'
		]);

	});

	/** 礼品记录 */
	$router->group(['prefix' => 'gift/record', 'middleware' => 'auth'], function () use ($router) {
		// Gift record
		$router->get('ofMy', [
			'as' => 'giftOfMy', 'uses' => '\App\Http\Controllers\Activity\Gift\RecordController@ofMy'
		]);

	});

});
